import java.util.Arrays;
import java.util.Scanner;

public class demo03 {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] arr=new int[n];
        for(int i=0;i<n;i++) {
            arr[i]=sc.nextInt();
        }
        int[] tmp=Arrays.copyOf(arr, n);
        Arrays.sort(tmp);
        int mid=n/2;
        int midoption=0;
        int option=0;
        int sameleft=0;
        int sameright=0;
        for(int i=mid-1,j=mid+1;i>=0;i--,j++) {
            if(tmp[i]==tmp[mid]) {
                sameleft++;
            }
            if(tmp[i]==tmp[mid]) {
                sameright++;
            }
            if(tmp[i]!=tmp[j]) {
                break;
            }
        }
        if(sameleft>sameright) {
            option=1;
        }
        for(int i=0;i<arr.length;i++) {
            int count=0;
            if(arr[i]==tmp[mid]) {
                count=option;
            }else if(arr[i]<tmp[mid]){
                count=tmp[mid]-arr[i]+1;
            }
            System.out.print(count+" ");
        }
    }
}
